package server;

import listeners.ClientListener;
import listeners.WeatherStationListener;

/**
 * Starts the Server
 * 
 * @author Nils Berlijn & Henderikus Harms
 */	
public class Server 
{
	private WeatherStationListener weatherStationListener;
	private ClientListener clientListener;
	
	/**
	 * Initialize the Listeners that will be used for the Server
	 */
	public Server()
	{
		weatherStationListener = new WeatherStationListener();
		clientListener = new ClientListener();
	}
	
	/**
	 * Starts the Server
	 * By making a Thread for the Weather Stations and the Clients
	 */
	public void start()
	{
		System.out.println("Server is running");
		
		Thread weatherStationThread = new Thread(weatherStationListener);
		weatherStationThread.start();
		
		Thread clientThread = new Thread(clientListener);
		clientThread.start();
	}
}